<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <form action="/open" method="get">
        <span>余额：<span id="money"></span></span>
        打开几楼：<br>
        5楼<input type="radio" name="floor" value="G4000717"/>
        4楼<input type="radio" name="floor" value="G4000658"/>
        3楼<input type="radio" name="floor" value="G4000687"/>
        <input type="submit" value="提交">
    </form>
    </body>
</html>
<script type="text/javascript">
    var money = document.getElementById('money');
    var xhr = new XMLHttpRequest();
    xhr.open('GET','/getmoney');
    xhr.send();
    xhr.onreadystatechange = function(){
        if(xhr.readyState == 4 && xhr.status == 200){
            money.innerHTML = xhr.responseText;
        }
    }       
</script>